#include "asm/regdef.h"
#include "asm/asm.h"
#include "asm/context.h"
#include "inst_test.h"
#include "trap.h"
    .set noreorder
    .global main 
    .text 

main:
    ###test inst
    TEST_SW(0x61754443, 0x801077a0, 0x00007b14, 0x00007b14, 0x61754443)
    TEST_SW(0x5c4fb45a, 0x80104aac, 0x0000776c, 0x0000776c, 0x5c4fb45a)
    TEST_SW(0x14908300, 0x80104ae8, 0x00005bd8, 0x00005bd8, 0x14908300)
    TEST_SW(0x516da739, 0x801060cc, 0x00008950, 0x00008950, 0x516da739)
    TEST_SW(0x85675a34, 0x80105510, 0x000030b0, 0x000030b0, 0x85675a34)
    TEST_SW(0x0e4dac98, 0x8010b040, 0x00004000, 0x00004000, 0x0e4dac98)
    TEST_SW(0xd9c6eddb, 0x80107180, 0x000022e0, 0x000022e0, 0xd9c6eddb)
    TEST_SW(0x5753dd01, 0x80102ca0, 0x00002780, 0x00002780, 0x5753dd01)
    TEST_SW(0xe543b9f3, 0x8010331c, 0x000069b8, 0x000069b8, 0xe543b9f3)
    TEST_SW(0x4726aca2, 0x80106cf8, 0x00005b70, 0x00005b70, 0x4726aca2)
    TEST_SW(0xb022040a, 0x80100800, 0x0000aa6c, 0x0000aa6c, 0xb022040a)
    TEST_SW(0x5ca0fd00, 0x80109834, 0x00005070, 0x00005070, 0x5ca0fd00)
    TEST_SW(0x063ba000, 0x80101c64, 0x000045fc, 0x000045fc, 0x063ba000)
    TEST_SW(0xc2268cfe, 0x801081e8, 0x00005c54, 0x00005c54, 0xc2268cfe)
    TEST_SW(0x1611444c, 0x80100484, 0x0000ec90, 0x0000ec90, 0x1611444c)
    TEST_SW(0x33cc6f2a, 0x801071dc, 0x00002e30, 0x00002e30, 0x33cc6f2a)
    TEST_SW(0xc2b46f21, 0x80101388, 0x00006264, 0x00006264, 0xc2b46f21)
    TEST_SW(0x63a86040, 0x801002a8, 0x0000bab0, 0x0000bab0, 0x63a86040)
    TEST_SW(0xe08d45d0, 0x80101d14, 0x0000daac, 0x0000daac, 0xe08d45d0)
    TEST_SW(0xf3839208, 0x80105308, 0x0000066c, 0x0000066c, 0xf3839208)
    TEST_SW(0x4268fd38, 0x80103f00, 0x000003c0, 0x000003c0, 0x4268fd38)
    TEST_SW(0x12816280, 0x80101b94, 0x00008aa0, 0x00008aa0, 0x12816280)
    TEST_SW(0x5404b496, 0x80101698, 0x0000e188, 0x0000e188, 0x5404b496)
    TEST_SW(0xf11c1c02, 0x80101de0, 0x0000b4c8, 0x0000b4c8, 0xf11c1c02)
    TEST_SW(0x31090da2, 0x80109400, 0x00001150, 0x00001150, 0x31090da2)
    TEST_SW(0x94809b50, 0x801027c8, 0x000024c0, 0x000024c0, 0x94809b50)
    TEST_SW(0xff1ed37c, 0x80101488, 0x0000d664, 0x0000d664, 0xff1ed37c)
    TEST_SW(0x5e23d200, 0x8010a074, 0x00002558, 0x00002558, 0x5e23d200)
    TEST_SW(0x68831248, 0x801063ec, 0x00005f40, 0x00005f40, 0x68831248)
    TEST_SW(0x4558e910, 0x80100cc0, 0x00003d8c, 0x00003d8c, 0x4558e910)
    TEST_SW(0xc98327b0, 0x801004e0, 0x0000a808, 0x0000a808, 0xc98327b0)
    TEST_SW(0xfea2f1ad, 0x80101b68, 0x0000adec, 0x0000adec, 0xfea2f1ad)
    TEST_SW(0xac52b354, 0x80110000, 0x0000c3dc, 0x0000c3dc, 0xac52b354)
    TEST_SW(0x4f612db4, 0x80110000, 0x00004a74, 0x00004a74, 0x4f612db4)
    TEST_SW(0x81e4a52c, 0x80110000, 0x00003370, 0x00003370, 0x81e4a52c)
    TEST_SW(0x6b615254, 0x80110000, 0x0000729c, 0x0000729c, 0x6b615254)
    TEST_SW(0x2447d85d, 0x80110000, 0x00007490, 0x00007490, 0x2447d85d)
    TEST_SW(0x8dde1c20, 0x80110000, 0x0000307c, 0x0000307c, 0x8dde1c20)
    TEST_SW(0xcf304a09, 0x80110000, 0x0000fba0, 0x0000fba0, 0xcf304a09)
    TEST_SW(0x431f45e2, 0x80110000, 0x0000ca58, 0x0000ca58, 0x431f45e2)
    TEST_SW(0x99db9a50, 0x80110000, 0x00003248, 0x00003248, 0x99db9a50)
    TEST_SW(0xe73f0fdc, 0x80110000, 0x00008718, 0x00008718, 0xe73f0fdc)
    TEST_SW(0x450bbdc0, 0x80110000, 0x00005128, 0x00005128, 0x450bbdc0)
    TEST_SW(0xc0c7c830, 0x80110000, 0x00008980, 0x00008980, 0xc0c7c830)
    TEST_SW(0x8006ca23, 0x80110000, 0x00005430, 0x00005430, 0x8006ca23)
    TEST_SW(0x40047d98, 0x80110000, 0x0000a5e8, 0x0000a5e8, 0x40047d98)
    TEST_SW(0xc95de720, 0x80110000, 0x00007c80, 0x00007c80, 0xc95de720)
    TEST_SW(0xd0476900, 0x80110000, 0x0000c2e0, 0x0000c2e0, 0xd0476900)
    TEST_SW(0x873f383a, 0x80110000, 0x000047b8, 0x000047b8, 0x873f383a)
    TEST_SW(0x50d54ce0, 0x80110000, 0x00008320, 0x00008320, 0x50d54ce0)
    TEST_SW(0x8502ea18, 0x80110000, 0x0000f2f0, 0x0000f2f0, 0x8502ea18)
    TEST_SW(0x09f2b630, 0x80110000, 0x0000aa24, 0x0000aa24, 0x09f2b630)
    TEST_SW(0xe8079b47, 0x80110000, 0x000041e0, 0x000041e0, 0xe8079b47)
    TEST_SW(0x5de6e330, 0x80110000, 0x00000000, 0x00000000, 0x5de6e330)
    TEST_SW(0xbf637404, 0x80110000, 0x00000000, 0x00000000, 0xbf637404)
    TEST_SW(0x99227ac0, 0x80110000, 0x00000000, 0x00000000, 0x99227ac0)
    TEST_SW(0xddecd270, 0x80110000, 0x00000000, 0x00000000, 0xddecd270)
    TEST_SW(0x06a06018, 0x80110000, 0x00000000, 0x00000000, 0x06a06018)
    TEST_SW(0xf428d0c8, 0x80110000, 0x00000000, 0x00000000, 0xf428d0c8)
    TEST_SW(0xa6ce33ec, 0x80110000, 0x00000000, 0x00000000, 0xa6ce33ec)
    TEST_SW(0xa7813bc0, 0x80110000, 0x00000000, 0x00000000, 0xa7813bc0)
    TEST_SW(0x72440e8c, 0x80110000, 0x00000000, 0x00000000, 0x72440e8c)
    TEST_SW(0xa4130340, 0x80110000, 0x00000000, 0x00000000, 0xa4130340)
    TEST_SW(0xb6ca0800, 0x80110000, 0x00000000, 0x00000000, 0xb6ca0800)
    TEST_SW(0x17331928, 0x80110000, 0x00000000, 0x00000000, 0x17331928)
    TEST_SW(0x09537c5f, 0x80110000, 0x00000000, 0x00000000, 0x09537c5f)
    TEST_SW(0x36964fd0, 0x80110000, 0x00000000, 0x00000000, 0x36964fd0)
    TEST_SW(0xe67b1aa6, 0x80110000, 0x00000000, 0x00000000, 0xe67b1aa6)
    TEST_SW(0x00000000, 0x80110000, 0x00000000, 0x00000000, 0x00000000)
    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP